require "test/unit"
require "./counter"

class CounterTest < Test::Unit::TestCase

  # Called before every test method runs. Can be used
  # to set up fixture information.
  def setup
    # Do nothing
    Counter.reset
  end

  # Called after every test method runs. Can be used to tear
  # down fixture information.
  def test_counter_counts
    assert_equal(0,Counter.count)
    Counter.counted_new
    assert_equal(1,Counter.count)
    Counter.counted_new
    assert_equal(2,Counter.count)
  end

  def test_counter_counts_2
    assert_equal(0,Counter.count)
    Counter.counted_new
    assert_equal(1,Counter.count)
    Counter.counted_new
    assert_equal(2,Counter.count)
  end

  def test_birth_order
    assert_equal(1, Counter.counted_new.birth_order)
    assert_equal(2, Counter.counted_new.birth_order)
  end
end